#pragma once

#include "NetTypes.h"
#include <deque>

namespace phynet{
namespace net{

class MessageHeader;
class BitStream;

class Channel
{
public:
	Channel()
		:m_seqNumber(0)
		,m_flag(Unreliable)
	{
	}
	
	~Channel()
	{
		//TODO ... memory management
	}

	void SetFlag(int i_flag) 
	{
		m_flag = i_flag;
	}
	
	int GetFlag() const 
	{
		return m_flag;
	}

	bool MessageSend(MessageHeader& io_header, const BitStream* i_message);

private:
	int m_flag;
	int m_seqNumber;
	typedef std::deque<BitStream*> Messages;
	Messages m_outQueue;

	//copy disabled
	Channel(const Channel&);
	Channel& operator=(const Channel&);
};

typedef std::vector<Channel*> Channels;

}} //namespaces